package com.jiyun.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jiyun.mapper.SysRegionMapper;
import com.jiyun.model.pojo.SysRegion;
import com.jiyun.model.query.SysRegionQuery;
import com.jiyun.service.SysRegionService;
import org.springframework.stereotype.Service;

@Service
public class SysRegionServiceImpl extends ServiceImpl<SysRegionMapper, SysRegion> implements SysRegionService {
    @Override
    public IPage<SysRegion> getPageList(SysRegionQuery query) {
        //1.创建查询条件
        QueryWrapper<SysRegion> qw = new QueryWrapper<>();
        //ToDo 查询条件

        //2.组件分页数据
        IPage<SysRegion> page = new Page<>(query.getCurrentPage(), query.getPageSize());
        //3.查询
        baseMapper.selectPage(page,qw);
        //4.返回
        return page;
    }
}
